import React, { useEffect } from 'react'
import ReactDOM from 'react-dom'
const container = document.createElement('div')
export default function Test() {
  useEffect(() => {
    document.getElementById('xxx').appendChild(container)
    return () => {
      document.getElementById('xxx').removeChild(container)
    }
  }, [])
  return ReactDOM.createPortal(<div>Test</div>, container)
}
